package com;

/**
 * @author wlg
 */
public class Main {
    public static void main(String[] args) {
        Account fa = new Account();
        fa.showWelcome();

        while (true) {
            System.out.print("请选择你要使用的功能(1-5)：");
            char f = Utility.ReadMenuSelection();
            switch (f) {
                // 收支明细
                case '1':
                    fa.showDetails();
                    break;
                case '2':
                    // 登记收入
                    System.out.print("请输入你的收入金额：");
                    int bcIn = Utility.readNumber();
                    System.out.print("请输入你的收入来源：");
                    fa.balanceIn(bcIn, Utility.readString());
                    break;
                case '3':
                    // 登记支出
                    System.out.print("请输入你的支出金额：");
                    int bcOut = Utility.readNumber();
                    System.out.print("请输入你的支出去向：");
                    fa.balanceOut(bcOut, Utility.readString());
                    break;
                case '4':
                    // 账户总额
                    System.out.println("账户的总额为：" + fa.getBalance() + "！！！");
                    break;
                case '5':
                    // 退出
                    System.out.print("请确认你的选择(Y/N)：");
                    if (Utility.readConfirmSelection() == 'Y') {
                        return;
                    }
                    break;
                default:
                    System.out.println("请输入正确的序号");
                    break;
            }
        }
    }
}
